home *** CD-ROM | disk | FTP | other *** search
- global gImages, gDataPos, gImageCount, theFirstImage, gPictSprite, gCenterH, gCenterV, gCurrentPict, gStartFrame, gEndFrame, gSpriteWidth, gSpriteHeight, gDistance
-
- on startMovie
- set the colorDepth to 8
- unLoad()
- setGlobals()
- set the itemDelimiter to ","
- hideShow(1, 48, 1, 4)
- end
-
- on preloadFirstImages
- set theList to "01A,02A,03A,04A,05A,06A,07A,08A,09A,10A,11A,12A,13A,14A,15A,16A"
- repeat with x = 1 to 16
- set whichCast to the number of member item x of theList
- if whichCast > 0 then
- preLoadCast(whichCast)
- end if
- end repeat
- end
-
- on setGlobals
- clearGlobals()
- set gPictSprite to 1
- set gCenterH to 320
- set gCenterV to 240
- set gCurrentPict to 1
- repeat with x = 2 to 48
- set the cursor of sprite x to 0
- end repeat
- end
-
- on selectModel whichModel
- if the timer < 20 then
- exit
- end if
- set gCurrentPict to whichModel
- set gStartFrame to label("Start " & gCurrentPict)
- set gEndFrame to label("End " & gCurrentPict)
- advanceFrame(0)
- set the cursor of sprite 2 to 0
- startTimer()
- end
-
- on advanceFrame frameModifier
- cursor(4)
- set currentRelativeFrame to checkRange(the frame, gStartFrame, gEndFrame)
- set newFrame to checkRangeWrap(currentRelativeFrame + frameModifier, gStartFrame, gEndFrame)
- if frameModifier = 0 then
- hideShow(1, 48, 0, 5)
- repeat with x = 3 to 15
- puppetSprite(x, 0)
- end repeat
- go("buttons")
- repeat with x = 3 to 15
- puppetSprite(x, 1)
- end repeat
- end if
- set the type of sprite 1 to 0
- updateStage()
- go(newFrame)
- if the type of sprite gPictSprite = 0 then
- puppetSprite(gPictSprite, 0)
- go(the frame)
- end if
- set gSpriteWidth to the width of cast the castNum of sprite gPictSprite / 2
- set gSpriteHeight to the height of cast the castNum of sprite gPictSprite / 2
- set gDistance to 20
- set the cursor of sprite 3 to -1
- hideShow(1, 9, 1, 5)
- if frameModifier <> 0 then
- preLoad(checkRangeWrap(newFrame - 1, gStartFrame, gEndFrame))
- end if
- preLoad(checkRangeWrap(newFrame + 1, gStartFrame, gEndFrame))
- set gPICThModifier to 0
- set gPICTvModifier to 0
- cursor(0)
- startTimer()
- end
-
- on correctPalette
- puppetPalette("System")
- updateStage()
- puppetPalette(0)
- updateStage()
- end
-
- on quickHide
- if the timer < 20 then
- exit
- end if
- set theList to []
- repeat with x = 1 to 48
- if the type of sprite x = 0 then
- setAt(theList, x, 0)
- else
- setAt(theList, x, [the visible of sprite x, the puppet of sprite x, the locV of sprite x])
- end if
- puppetSprite(x, 1)
- set the locV of sprite x to -500
- set the visible of sprite x to 0
- end repeat
- updateStage()
- set howLong to the timer + 20
- repeat while (the timer < howLong) or the mouseUp
- updateStage()
- end repeat
- repeat while the mouseDown
- updateStage()
- end repeat
- updateStage()
- repeat with x = 1 to 48
- set theListItem to getAt(theList, x)
- if listp(theListItem) then
- set the visible of sprite x to getAt(theListItem, 1)
- puppetSprite(x, getAt(theListItem, 2))
- set the locV of sprite x to getAt(theListItem, 3)
- end if
- end repeat
- updateStage()
- startTimer()
- end
-
- on hideShow startSprite, endSprite, theVisible, whichTransition
- repeat with x = startSprite to endSprite
- set the visible of sprite x to theVisible
- end repeat
- if theVisible = 0 then
- repeat with x = startSprite to endSprite
- if the puppet of sprite x = 0 then
- set the locV of sprite x to -500
- end if
- end repeat
- end if
- puppetTransition(whichTransition, 1, 12)
- updateStage()
- end
-
- on moveSprites startSprite, endSprite, posOrNeg
- repeat with x = startSprite to endSprite
- set the locV of sprite x to posOrNeg * abs(the locV of sprite x)
- end repeat
- updateStage()
- end
-
- on returnToMenu
- hideShow(1, 48, 0, 5)
- repeat with x = 1 to 48
- puppetSprite(x, 1)
- set the locV of sprite x to -500
- end repeat
- go(label("menu") + 1)
- repeat with x = 1 to 48
- puppetSprite(x, 0)
- set the visible of sprite x to 1
- end repeat
- set the visible of sprite 1 to 0
- go(the frame + 1)
- cursor(0)
- cursor(-1)
- startTimer()
- end
-
- on zoomSprite whichSprite, userClickLoc, centerH, centerV
- if the type of sprite whichSprite = 0 then
- exit
- end if
- set the stretch of sprite whichSprite to not (the stretch of sprite whichSprite)
- if the stretch of sprite whichSprite = 1 then
- go(the frame)
- else
- set centerLoc to point(centerH, centerV)
- set zoomLoc to stripPoint(centerLoc - userClickLoc)
- set spriteWidth to the width of cast the castNum of sprite gPictSprite / 2
- set spriteHeight to the height of cast the castNum of sprite gPictSprite / 2
- set newH to checkRange(centerH + value(item 1 of zoomLoc), 640 - spriteWidth, spriteWidth)
- set newV to checkRange(centerV + value(item 2 of zoomLoc), the top of sprite 3 - spriteHeight, spriteHeight)
- set the locH of sprite whichSprite to newH
- set the locV of sprite whichSprite to newV
- end if
- updateStage()
- end
-
- on stripPoint whichPoint
- set whichPoint to string(whichPoint)
- set firstChar to offset("(", whichPoint) + 1
- set lastChar to the number of chars in whichPoint - 1
- set whichPoint to char firstChar to lastChar of whichPoint
- return whichPoint
- end
-
- on checkRange originalNumber, minValue, maxValue
- if originalNumber < minValue then
- set originalNumber to minValue
- else
- if originalNumber > maxValue then
- set originalNumber to maxValue
- end if
- end if
- return originalNumber
- end
-
- on checkRangeWrap originalNumber, minValue, maxValue
- if originalNumber < minValue then
- set originalNumber to maxValue - (minValue - originalNumber) + 1
- else
- if originalNumber > maxValue then
- set originalNumber to minValue + (originalNumber - maxValue) - 1
- end if
- end if
- return originalNumber
- end
-
- on zoomPICT whichSprite, userClickLoc, centerH, centerV
- if the type of sprite whichSprite = 0 then
- exit
- end if
- set the stretch of sprite whichSprite to not (the stretch of sprite whichSprite)
- if the stretch of sprite whichSprite = 1 then
- set magnificationFactor to 2
- set whichCast to the castNum of sprite whichSprite
- set newHeight to the height of cast whichCast / (magnificationFactor * 2)
- set newWidth to the width of cast whichCast / (magnificationFactor * 2)
- spriteBox(whichSprite, centerH - newWidth, centerV - newHeight, centerH + newWidth, centerV + newHeight)
- else
- set centerLoc to point(centerH, centerV)
- set zoomLoc to stripPoint(centerLoc - userClickLoc)
- set the locH of sprite whichSprite to centerH + value(item 1 of zoomLoc)
- set the locV of sprite whichSprite to centerV + value(item 2 of zoomLoc)
- end if
- updateStage()
- end
-
- on zoomPICTtoCenterHV whichSprite, userClickLoc, centerH, centerV
- if the type of sprite whichSprite = 0 then
- exit
- end if
- set the stretch of sprite whichSprite to not (the stretch of sprite whichSprite)
- set magnificationFactor to 2
- if the stretch of sprite whichSprite = 1 then
- set whichCast to the castNum of sprite whichSprite
- set newHeight to the height of cast whichCast / (magnificationFactor * 2)
- set newWidth to the width of cast whichCast / (magnificationFactor * 2)
- spriteBox(whichSprite, centerH - newWidth, centerV - newHeight, centerH + newWidth, centerV + newHeight)
- else
- set centerLoc to point(centerH, centerV)
- set zoomLoc to stripPoint(userClickLoc - centerLoc)
- set the locH of sprite whichSprite to centerH - (value(item 1 of zoomLoc) * magnificationFactor)
- set the locV of sprite whichSprite to centerV - (value(item 2 of zoomLoc) * magnificationFactor)
- end if
- updateStage()
- end
-
- on getMagnificationFactor whichSprite, heightOrWidth
- set whichCast to the castNum of sprite whichSprite
- if heightOrWidth = 0 then
- set castHeight to the height of cast whichCast
- set spriteHeight to the height of cast whichCast
- return 1.0 * castHeight / spriteHeight
- else
- set castWidth to the width of cast whichCast
- set spriteWidth to the width of cast whichCast
- return 1.0 * castWidth / spriteWidth
- end if
- end
-